package com.xinchao.dao;

import com.xinchao.model.DeviceLog;
import org.apache.ibatis.annotations.*;

public interface DeviceLogMapper {
    @Delete({
        "delete from ck_device_log",
        "where device_log_id = #{deviceLogId,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long deviceLogId);

    @Insert({
        "insert into ck_device_log (device_log_id, device_mac, ",
        "package_name, file_download_url, ",
        "upload_time)",
        "values (#{deviceLogId,jdbcType=BIGINT}, #{deviceMac,jdbcType=VARCHAR}, ",
        "#{packageName,jdbcType=VARCHAR}, #{fileDownloadUrl,jdbcType=VARCHAR}, ",
        "#{uploadTime,jdbcType=BIGINT})"
    })
    int insert(DeviceLog record);

    int insertSelective(DeviceLog record);

    @Select({
        "select",
        "device_log_id, device_mac, package_name, file_download_url, upload_time",
        "from ck_device_log",
        "where device_log_id = #{deviceLogId,jdbcType=BIGINT}"
    })
    DeviceLog selectByPrimaryKey(Long deviceLogId);

    int updateByPrimaryKeySelective(DeviceLog record);

    @Update({
        "update ck_device_log",
        "set device_mac = #{deviceMac,jdbcType=VARCHAR},",
          "package_name = #{packageName,jdbcType=VARCHAR},",
          "file_download_url = #{fileDownloadUrl,jdbcType=VARCHAR},",
          "upload_time = #{uploadTime,jdbcType=BIGINT}",
        "where device_log_id = #{deviceLogId,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(DeviceLog record);
}